package com.yl.rabbitmq.day10;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.yl.rabbitmq.utils.RabbitMQUtil;

/**
 * @author yangl
 * 死信队列之生产者
 */
public class Product {
    /**
     * 普通交换机的名称
     */
    private static final String NORMAL_EXCHANGE = "normal_exchange02";

    public static void main(String[] args) throws Exception{
        Channel channel = RabbitMQUtil.getChannel();

        //发送一个死信消息
        for (int i = 1; i < 11; i++) {
            String message = "info" + i;
            channel.basicPublish(NORMAL_EXCHANGE, "zhangsan", null, message.getBytes("UTF-8"));
        }
    }
}
